import {defineConfig} from "vite";
import vue from "@vitejs/plugin-vue";
import path from 'path';

export default defineConfig({
    plugins: [

        vue(),
    ],
    base: process.env.NODE_ENV === "production" ? "./" : "/",
    build: {
        outDir: 'docs' // 打包文件的输出目录
    },
    resolve: {
        alias: {
            '@': path.resolve(__dirname, './src'),
        }
    },

    server: {
        // https: true,

        proxy: {
            "/italent": {
                target: "https://www.italent.cn/",
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/italent/, ""),
            },
        },
    },

});